
echo off

SET HOUR=%time:~0,2%
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%%time:~6,2% 
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%

if "%HOUR:~0,1%" == " " (SET dtStamp=%dtStamp9%) else (SET dtStamp=%dtStamp24%)


echo "restart" > %~dp0Restart%dtStamp%.txt


erase %~dp2mongod.lock 
echo "lock delete ok" >> %~dp0Restart%dtStamp%.txt 
rename %1 backupMongodlog.%dtStamp%.log

echo "rename ok" >> %~dp0Restart%dtStamp%.txt 

call net start mongodb
echo "start ok" >> %~dp0Restart%dtStamp%.txt 